
/*
*
* 热门搜索-界面对象类
*
* */


///热门词汇
class HotWords{
  List<HotWordsList> list=[];
  HotWords.fromJson(Map<String, dynamic> json) {
    if (json["list"] != null) {
      json["list"].forEach((v) {
        if (v is HotWordsList) {
          list.add(v);
        }else{
          list.add(HotWordsList.fromJson(v));
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["list"]=list;
    return map;
  }


}

class HotWordsList{
  int rank;
  String name;
  int count;
  String creatorname;
  int creatorid;


  HotWordsList({
      this.rank, this.name, this.count, this.creatorname, this.creatorid});

  HotWordsList.fromJson(Map<String, dynamic> json) {
    rank = json["rank"];
    name = json["name"];
    count = json["count"];
    creatorname=json["creatorName"];
    creatorid=json["creatorId"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["rank"] = rank;
    map["name"] = name;
    map["count"] = count;
    map["creatorName"] = creatorname;
    map["creatorId"] = creatorid;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}


///热门话题
class HotTopic {
  List<HotToppicList> list = [];

  HotTopic.fromJson(Map<String, dynamic> json) {
    if (json["list"] != null) {
      json["list"].forEach((v) {
        if (v is HotToppicList) {
          list.add(v);
        } else {
          list.add(HotToppicList.fromJson(v));
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["list"]=list;
    return map;
  }
}


class HotToppicList{
  int id;
  String name;
  int creatorId;
  int isNew;
  int feedCount;
  int memberCount;
  int backgroundColorId;
  int patternId;
  String backgroundColor;
  int dataState;
  int createTime;
  int updateTime;
  int isFollow;
  String description;
  String feedList;

  List<Pics> pics=[];


  HotToppicList({
      this.id,
      this.name,
      this.creatorId,
      this.isNew,
      this.feedCount,
      this.memberCount,
      this.backgroundColorId,
      this.patternId,
      this.backgroundColor,
      this.dataState,
      this.createTime,
      this.updateTime,
      this.isFollow,
      this.description,
      this.feedList,
      this.pics});

  HotToppicList.fromJson(Map<String, dynamic> json) {
    id = json["id"];
    name = json["name"];
    creatorId = json["creatorId"];
    isNew=json["isNew"];
    feedCount = json["feedCount"];
    memberCount = json["memberCount"];
    backgroundColorId = json["backgroundColorId"];
    patternId=json["patternId"];
    backgroundColor = json["backgroundColor"];
    dataState = json["dataState"];
    createTime = json["createTime"];
    updateTime=json["updateTime"];
    isFollow=json["isFollow"];
    description=json["description"];
    feedList=json["feedList"];
    if (json["pics"] != null) {
      json["pics"].forEach((v) {
        if (v is Pics) {
          pics.add(v);
        }else{
          pics.add(Pics.fromJson(v));
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"]=id;
    map["name"]=name;
    map["creatorId"]=creatorId;
    map["isNew"]=isNew;
     map["feedCount"]=feedCount;
    map["memberCount"]=memberCount;
    map["backgroundColorId"]=backgroundColorId;
    map["patternId"]=patternId;
    map["backgroundColor"]=backgroundColor;
    map["dataState"]=dataState;
    map["createTime"]=createTime;
    map["updateTime"]=updateTime;
    map["isFollow"]=isFollow;
    map["description"]=description;
    map["feedList"]=feedList;
    map["pics"]=pics;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}


class Pics{
  String url;
  String hlsUrl;
  int duration;
  String coverUrl;
  int width;
  int height;
  double offsetRatioX;
  double offsetRatioY;
  double videoCroppedRatio;

  Pics({
      this.url,
      this.hlsUrl,
      this.duration,
      this.coverUrl,
      this.width,
      this.height,
      this.offsetRatioX,
      this.offsetRatioY,
      this.videoCroppedRatio});

  Pics.fromJson(Map<String, dynamic> json) {
    url = json["url"];
    hlsUrl = json["hlsUrl"];
    duration = json["duration"];
    coverUrl=json["coverUrl"];
    width = json["width"];
    height = json["height"];
    offsetRatioX = json["offsetRatioX"];
    offsetRatioY=json["offsetRatioY"];
    videoCroppedRatio = json["videoCroppedRatio"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["url"]=url;
    map["hlsUrl"]=hlsUrl;
    map["duration"]=duration;
    map["coverUrl"]=coverUrl;
    map["width"]=width;
    map["height"]=height;
    map["offsetRatioX"]=offsetRatioX;
    map["offsetRatioY"]=offsetRatioY;
    map["videoCroppedRatio"]=videoCroppedRatio;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}